
local filePath = "Compare.txt"
local outputPath = "Compare.csv"

local source = io.open(filePath, "r")
local target = io.open(outputPath, "a+")
local str = source:read("*all")
local name, dps, err = str:match([[Player: (%S+) %S+ %S+ %S+ %S+
  DPS: ([%d%.]+)  DPS%-Error=([%d%.]+)]])

if name and tonumber(dps) > 0 then
	print(name, dps, err)
	target:write(name, "\t ", dps, "\t", err, "\n")
end

source:close()
target:close()
